package com.ruige.data.config;

public class DataSourceContextHolder {

    private static final ThreadLocal<String> local = new ThreadLocal<String>();

    public static ThreadLocal<String> getLocal() {
        return local;
    }

    public static void huapu() {
        System.out.println("切换到huapu-db");
        local.set(DataSourceType.HUAPU.getType());
    }

    public static void local() {
        System.out.println("切换到local-db");
        local.set(DataSourceType.LOCAL.getType());
    }

    public static String getDataSourceType() {
        return local.get();
    }

}